import path from 'node:path'
import process from 'node:process'
import vue from '@vitejs/plugin-vue'
import { defineConfig } from 'vite'
import removeConsole from 'vite-plugin-remove-console'
import vueDevTools from 'vite-plugin-vue-devtools'

// https://vite.dev/config/
export default defineConfig(({ mode }) => ({
  plugins: [
    vue(),
    vueDevTools({
      launchEditor: process.env.EDITOR,
    }),
    mode === 'production' && removeConsole(),
  ],
  resolve: {
    alias: {
      '@': path.resolve('./src'),
    },
  },
}))
